clear


ssc install ivreg2
ssc install qvf


use "/Users/scottfabramson/Dropbox/Job Market Paper/IO Revisions/Replication_Files/Replication_Appendix/A_Table_4/data_table_a4.dta"




tsset ID Year

tabulate Year, g(y)
generate instrument= abs(Temp-10.5)
generate treatment= log(Urban_Pop+.001)
gen lincome = log(income)
gen post = 1 if y4 == 1 | y5 ==1 | y6==1 |  y7==1






*** Column 1 *** 


ivreg2 Entrants lincome (treatment=instrument), cluster(ID) 

eststo a1

*** Column 2 *** 


ivreg2 Entrants lincome y1 y2 y3 y4 y5 y6 (treatment=instrument), cluster(ID) 

eststo a2


*** Column 3 *** 


ivreg2 Entrants lincome X Y y1 y2 y3 y4 y5 y6 (treatment=instrument), cluster(ID) 

eststo a3


*** Column 4 *** 

ivreg2 Entrants lincome (treatment=instrument), cluster(ID), if post ==1

eststo a4


*** Column 5 *** 



ivreg2 Entrants lincome y1 y2 y3 y4 y5 y6 (treatment=instrument), cluster(ID), if post ==1


eststo a5


*** Column 6 *** 




ivreg2 Entrants lincome y1 y2 y3 y4 y5 y6 X Y (treatment=instrument), cluster(ID), if post ==1


eststo a6




 **** This Gives Table A3 *****
 
estout a1 a2 a3 a4 a5 a6, cells(b(star fmt(2))  ci(par fmt(2))) style(tex) drop(y* X Y _cons)





****** IV Poisson and IV Neg Bin Models Not Included in Apppendix But presented here. Identical Substantive Results *********


ivpois Entrants lincome, exog(instrument) endog(treatment) 

 

ivpois Entrants lincome y1 y2 y3 y4 y5 y6, exog(instrument) endog(treatment)



ivpois Entrants lincome y1 y2 y3 y4 y5 y6 X Y, exog(instrument) endog(treatment)





***** ***** ***** IV Neg Bin ***** ***** ***** ***** 

qvf Entrants treatment lincome (instrument lincome),  family(nbinomial) cluster(ID) 

qvf Entrants treatment lincome y1 y2 y3 y4 y5 y6 (instrument y1 y2 y3 y4 y5 y6 lincome),  family(nbinomial) cluster(ID) 

qvf Entrants treatment  lincome y1 y2 y3 y4 y5 y6 X Y (instrument y1 y2 y3 y4 y5 y6 X Y lincome),  family(nbinomial) cluster(ID) 









